import React, { Suspense } from 'react'
import { RouterProvider } from 'react-router-dom'
import { Spin } from 'antd'
import { router } from './router'
import { ErrorBoundary } from './components/ErrorBoundary'
import { I18nProvider } from './contexts/I18nProvider'

export const App: React.FC = () => {
  return (
    <ErrorBoundary>
      <I18nProvider>
        <Suspense fallback={<Spin className="flex items-center justify-center h-screen" size="large" />}>
          <RouterProvider router={router} />
        </Suspense>
      </I18nProvider>
    </ErrorBoundary>
  );
};